package com.hua.designpattern.j2eepattern.servicelocator;

import java.util.HashMap;
import java.util.Map;

public class ServiceCache {
	private Map<String, ServiceInterface> cache = new HashMap<String, ServiceInterface>();

	public ServiceCache addCache(ServiceInterface service) {
		cache.put(service.getName(), service);
		return this;
	}

	public ServiceInterface getService(String jndiName) {
		return cache.get(jndiName);
	}

}
